package com.vma.jifu.controller;

import com.vma.jifu.others.SystemMessageService;

/**
 * Created by chenzui on 2017/7/20.
 */
public class SystemMessageController extends BaseController {
    private SystemMessageService systemMessageService = new SystemMessageService();

    public void qryList(){
        Integer userId = getParaToInt("userId");
        Integer cPage = getParaToInt("cPage");
        Integer pSize = getParaToInt("pSize");
        renderRes(systemMessageService.qryList(userId,cPage,pSize));
    }

    public void getById(){
        Integer id = getParaToInt("id");
        renderRes(systemMessageService.getById(id));
    }

    public void update(){
        Integer id = getParaToInt("id");
        systemMessageService.update(id);
        renderRes("success");
    }

    public void delete(){
        Integer id = getParaToInt("id");
        systemMessageService.delete(id);
        renderRes("success");
    }

    public void qryUnReadMsg(){
        Integer userId = getParaToInt("userId");
        renderRes(systemMessageService.qryUnReadMsg(userId));
    }
}
